//改变商品数量
export const changeGoodNum = (id, num,cb) => {
     $.ajax({
        type: "post",
        url: _changeGoodNumUrl,
        data: {
            goodid: id,
            num: num
        },
        dataType: "json",
        success:function (res) { 
            cb(res);
         }
    });
};

//获取某个商品在购物车中的数量
const getGoodNum=(gid,cb)=>{

    $.ajax({
        type: "post",
        url: url,
        data: {
            gooid:id
        },
        dataType: "json",
        success: function (res) {
            cb(res);
        }
    });

};

//获取搜索商品列表
export const getGoodList=(keyword,cid,page,cb)=>{
    $.ajax({
        type: "get",
        url: searchList,
        data: {
            keyword:keyword,
            cid:cid,
            page:page
        },
        dataType: "json",
        success: function (res) {
            cb(res);
        }
    });

};
export const delGood = (id,gids,fn) => {
    $.ajax({
        type: "post",
        url: _delGoodUrl,
        data: {
            gids:gids,
            cartid: id
        },
        dataType: "json",
        success:function (res) {
            fn(res);
        }
    });
};